package entity;
import java.util.ArrayList;
import java.util.Random;
public class ItemCollection {
    public ArrayList<ImageItem> imageItems;
    private Random rgen;
    
    public ItemCollection()
    {
        this.imageItems = new ArrayList<ImageItem>();
        this.rgen = new Random();
    }
    public ImageItem[] pickOne()
    {
        ImageItem ret[] = new ImageItem[2];
        if(this.imageItems.size() < 1){return null;}
        int indexa = this.rgen.nextInt(this.imageItems.size());
        int indexb = this.rgen.nextInt(this.imageItems.size());
        while(indexa == indexb)
        {
            indexb = this.rgen.nextInt(this.imageItems.size());
        }
        ret[0] = this.imageItems.get(indexa);
        ret[1] = this.imageItems.get(indexb);
        return ret;
    }
    
}
